<?php

namespace App\Controller\Admin\Activity;

use App\Controller\Admin\BaseController;
use App\Service\Activity\ActivityService;
use Hyperf\Di\Annotation\Inject;
use Yj\Apidog\Annotation\ApiController;
use Yj\Apidog\Annotation\FormData;
use Yj\Apidog\Annotation\PostApi;

/**
 * @ApiController(prefix="admin/activity/activity")
 */
class ActivityController extends BaseController
{
    /**
     * @Inject()
     * @var ActivityService
     */
    protected $activityService;

    /**
     * @PostApi(path="lists")
     */
    public function lists(){
        $data = $this->activityService->lists();
        _SUCCESS($data);
    }
    /**
     * @PostApi(path="add",description="添加")
     * @FormData(key="title",rule="required")
     */
    public function add(){
        $params = $this->getValidatorData();
        $this->activityService->add($params);
        _SUCCESS();
    }
}